import { NestFactory } from '@nestjs/core';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { AdminModule } from './admin.module';

async function bootstrap() {
  const app = await NestFactory.create(AdminModule);

  //api配置文档
  const config = new DocumentBuilder()
  .setTitle('后台管理Api')
  .setDescription('后台管理界面调用Api')
  .setVersion('1.0')
  .build();
  const document = SwaggerModule.createDocument(app, config);
  SwaggerModule.setup('api-docs', app, document);
  await app.listen(5000);
  console.log('http://localhost:3000/api-docs')
 
}
bootstrap();
